/*
 * Last review by   : Yaser
 * Last review date : JUL-25-09 
 */
using System;

namespace ERP.Framework.Components.DatabaseHelper
{
    /// <summary>
    /// Parameter definition
    /// </summary>
    public class Parameter
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="Parameter"/> class.
        /// </summary>
        /// <param name="parameterName">Name of the parameter.</param>
        /// <param name="value">The value.</param>
        /// <param name="type">The type.</param>
        /// <param name="direction">The direction.</param>
        public Parameter(string parameterName, object value, ParameterType type, ParameterDirection direction)
        {
            Name = parameterName;
            Value = (value == null ? DBNull.Value : value);
            Type = type;
            Direction = direction;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Parameter"/> class.
        /// </summary>
        /// <param name="parameterName">Name of the parameter.</param>
        /// <param name="value">The value.</param>
        /// <param name="type">The type.</param>
        public Parameter(string parameterName, object value, ParameterType type) : this(parameterName, value, type, ParameterDirection.InParameter) { }

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        /// <value>The value.</value>
        public object Value
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the direction.
        /// </summary>
        /// <value>The direction.</value>
        public ParameterDirection Direction
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the type.
        /// </summary>
        /// <value>The type.</value>
        public ParameterType Type
        {
            get;
            set;
        }

        #endregion
    }
}
